package com.openapi.openapi.controller;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.openapi.openapi.utils.ExceptionUtil;
import com.openapi.openapi.vo.ErrorRes;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;



/**
 * Created by 高立新(gaolixin622@126.com) on 2017-11-28.
 */
public class BaseController {

    @ExceptionHandler(Throwable.class)
    public ErrorRes __exp__(HttpServletRequest request, HttpServletResponse httpServletResponse, Exception ex) throws JsonProcessingException {
        return new ErrorRes( ExceptionUtil.getExceptionDetail(ex));
    }
}
